<template>
  <div class="mui-numbox" data-numbox-min="1" data-numbox-max="9">
    <button class="mui-btn mui-btn-numbox-minus" type="button" @click="jian" ref="numbox">-</button>
    <input id="test" class="mui-input-numbox" type="number" :value="num" />
    <button class="mui-btn mui-btn-numbox-plus" type="button" @click="jia" ref="numbox">+</button>
  </div>
</template>
<script>
//import mui from "../../lib/dist/js/mui.min.js"
export default {
  data(){
    return{
      num:1
    }
  },
  methods:{
    jian(){
      this.num--;
      if(!this.num){
        this.num=1;
      }
      this.$emit('getcount',parseInt(this.num));
    },
    jia(){
      this.num++;
      this.$emit('getcount',parseInt(this.num));
    }
  }
    // mounted(){
    //     mui(".mui-numbox").numbox();
    // }
};
</script>
<style lang="scss" scoped>
</style>
